<?
	require_once('phpquickforms.php');
	
$form = new formBuilder('testForm');

$form->load('
fieldset1:
  type: newFieldset
  properties: My Fieldset
frm_name:
  type: textfield
  properties:
    label: Name
    maxlength: 40
    size: 20
    value: Name
    required: true
    rules: max_length[40]
endFieldset1:
  type: endFieldset
frm_select:
  type: select
  properties:
    label: Select Box
    options:
      1: Select 1
      2: Select 2
      3: Select 3
    selected: 2
division1:
  type: addDivision
frm_checkbox:
  type: checkbox
  properties:
    label: Check This
    checked: true
    value: CheckBox
division2:
  type: addDivision
frm_radio:
  type: radio
  properties:
    label: Radio Buttons
    buttons:
      1: Button 1
      2: Button 2
      3: Button 3
    selected: 2
division3:
  type: addDivision
frm_comments:
  type: textarea
  properties:
    label: Comments
    cols: 20
    rows: 10
    rules: required,min_length[10]
division4:
  type: addDivision
frm_submit:
  type: submit
  properties:
    value: Submit
');

/*
$form->addElement('fieldset1','newFieldset','My Fieldset');
$form->addElement('frm_name', 'textfield', $properties = array(
	label =>  "Name",
	maxlength => 40,
	size => 20,
	value => "Name",
	required => true,
	rules => "alpha_dash_numeric,required,max_length[40]"
	)
);
$form->addElement('endFieldset1','endFieldset');
$form->addElement('frm_select','select', $properties = array(
	label => "Select Box",
	options => array(
		1 => "Select 1",
		2 => "Select 2",
		3 => "Select 3"
		),
	selected => 2
	)
);
$form->addElement('division1','addDivision');
$form->addElement('frm_checkbox','checkbox', $properties = array(
	label => "Check This",
	checked => 'true',
	value => 'CheckBox'
	)
);
$form->addElement('division2','addDivision');
$form->addElement('frm_radio','radio', $properties = array(
	label => "Radio Buttons",
	buttons => array(
		1 => "Button 1",
		2 => "Button 2",
		3 => "Button 3"
		),
	selected => 2
	)
);
$form->addElement('division3','addDivision');
$form->addElement('frm_comments','textarea', $properties = array(
	label => "Comments",
	cols => 20,
	rows => 10,
	rules => "required,min_length[10]"
	)
);
$form->addElement('division4','addDivision');
$form->addElement('frmID','hidden',array(value=>'myForm'));
$form->addElement('frm_submit','submit',array(value=>'Submit'));
*/


?><!DOCTYPE PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>wwnetFormApi Test</title>
  <style>
   div.clearer{clear:both;}
  </style>
 </head>
 <body>
<?php 

//printForm();
$form->clean();


/*
foreach($formElements as $name => $each){
	echo $name . ' is a ' . $each['type'] . '<br>';
//	var_dump($each);
//	var_dump($each['properties']);
	echo '<br>';
}
*/
?>
</body>
</html>
